<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<div th:fragment="num">

    <template id="num">
        <div class="num">
            <p>{{count}}</p>
            <el-button @click="add">add</el-button>
        </div>
    </template>

    <script>
        const Num = {
            template: '#num',
            data() {
                return {
                    count:0,
                }
            },
            methods: {
                add(){
                    this.count = this.count+1;
                }
            }
        }
    </script>
</div>
</html>